package com.taotao.controller;

import com.taotao.common.pojo.EasyUITreeNode;
import com.taotao.service.IItemCatService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.ResponseBody;

import java.util.List;

/**
 * @author zhangxiaolin@zhonhajt.com
 * @Title: 商品类目管理controller
 * @Package com.taotao.controller
 * @Description:
 * @date 2018/10/11 21:08
 */
@Controller
@RequestMapping("/item/cat")
public class ItemCatController {

    @Autowired
    private IItemCatService iItemCatService;

    @RequestMapping("/list")
    @ResponseBody
    public List<EasyUITreeNode> getItemCatList(@RequestParam(value = "id", defaultValue = "0") Long parentId) {
        List<EasyUITreeNode> nodeList = iItemCatService.getItemCatList(parentId);
        return nodeList;
    }
}
